import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-07-27  19:23
 */
public class Test2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(facSum(n));
    }

    public static int facSum(int n) {
        int sum = 0;
        for (int i = 1; i <=n ; i++) {
                sum += fac(i);
            }
        return sum;
        }
    public static int fac(int n) {
        int ret = 1;
        for (int i = 1; i <=n ; i++) {
                ret *= i;
        }
        return ret;
    }
}
